package com.mall.dao;

import com.mall.pojo.MmallCart;
import com.mall.pojo.MmallCartExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface MmallCartMapper {
    int countByExample(MmallCartExample example);

    int deleteByExample(MmallCartExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MmallCart record);

    int insertSelective(MmallCart record);

    List<MmallCart> selectByExample(MmallCartExample example);

    MmallCart selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MmallCart record, @Param("example") MmallCartExample example);

    int updateByExample(@Param("record") MmallCart record, @Param("example") MmallCartExample example);

    int updateByPrimaryKeySelective(MmallCart record);

    int updateByPrimaryKey(MmallCart record);

	MmallCart selectByProductIdAndUserId(@Param("productId")Integer productId,@Param("userId")Integer userId);

	List<MmallCart> selectCartByUserId(Integer userId);
	
	int selectCartProductCheckedStatusByUserId(Integer userId);
  
	int deleteByUserIdProductIds(@Param("userId")Integer userId,@Param("productIdList")List<String> productIdList);

	int selectOrUnSelect(@Param("userId")Integer userId,@Param("productId")Integer productId,@Param("checked")Integer checked);

	int selectCartProductCount(Integer userId);
 
	List<MmallCart> selectCartCheckedByUserId(Integer userId); 
	
}